package com.one.api.common.msg.entity;

import com.one.api.common.util.DateUtil;
import com.one.api.common.util.RandomUtil;
import net.sf.json.JSONObject;

import java.util.Date;

public class MsgHead {
    private String id = RandomUtil.randomUUid();
    private String time = DateUtil.formatStan(new Date());

    public static MsgHead build(){
        MsgHead head=new MsgHead();
        head.id=RandomUtil.randomUUid();
        head.time=DateUtil.formatStan(new Date());
        return head;
    }

    @Override
    public String toString() {
        return JSONObject.fromObject(this).toString();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }
}
